import {getAllUser} from "../services/test1";

export default {
  namespace: 'touchUser',

  state: {
    data: {},
    users:[],
  },

  effects: {
    *getAllUser(_, { call, put }) {
      const response = yield call(getAllUser);
      yield put({
        type: 'save',
        payload: response,
      });
    },

  },

  reducers: {
    save(state, action) {
      return {
        ...state,
        data: action.payload,
        users:action.payload.data,
      };
    },
  },
};
